import { request } from '@/utils/http';
import type { GetCodeParams,GetCodeData,LoginCodeParams, LoginData,LoginParams, loginPassword, loginPasswordData, UserData} from "@/types/user"


// 1.密码登录
export const loginApi = (data:LoginParams) => request.post<null,LoginData>('/login/password',data)
//2.获取验证码登录
export const getCodeApi = (params: GetCodeParams) => request.get<null, GetCodeData>('/code', {params})
// 3. 验证码登录
export const loginByMobileApi = (data: LoginCodeParams) => request.post<null, LoginData>('/login', data)
// 4.密码登录
export const loginPasswordApi = (data:loginPassword) => request.post<null,loginPasswordData>('/login/password',data)
// 5.获取用户信息
export const getUserInfoApi  = () => request.get<null,UserData>('/patient/myUser')